//
//  Message.h
//  WCDB_Demo
//
//  Created by lxj on 2018/7/25.
//  Copyright © 2018年 lxj. All rights reserved.
//

#import <Foundation/Foundation.h>


@interface Message : NSObject

@property(nonatomic, retain) NSString *userId;
@property(nonatomic, retain) NSString *username;
@property(nonatomic, retain) NSString *remarkname;

@property(nonatomic, retain) NSString * headImageUrl;
 


/**
 增

 @param object 对象
 */
+ (BOOL)insertObject:(Message *)object;

/**
 批量插入

 @param array 数组
 @param useTransaction 是否使用事务
 @return 结果
 */
+ (BOOL)insertObjects:(NSArray<Message *> *)array useTransaction:(BOOL)useTransaction;

/**
 查

 @return 数组
 */
+ (NSArray<Message *> *)getAllObjects;



+ (Message *)getOneObjectByUserID:(NSString *)userID;
/**
 改

 @param message 对象
 @return 结果
 */
+ (BOOL)updateAllRowsWithObject:(Message *)message;

/**
 删

 @return 结果
 */
+ (BOOL)deleteAllObjects;
+ (BOOL)deleteByUserId:(NSString*)userId;
#pragma mark - FTS
+ (BOOL)insertObjectFTS:(Message *)object;
+ (NSArray<Message *> *)getObjectsFTSByText:(NSString *)text;
+ (BOOL)deleteFTSByUserId:(NSInteger)userId;
@end
